package edu.uoc.tdp.pac4.beans;

import java.io.Serializable;
import java.sql.Date;

public class Registration implements Serializable{
	

	private static final long serialVersionUID = 1L;
	private int registrationId;
	private int groupId;
	private int courseId;
	private int status;
	private String userId;
	private int requestId;
	private Date modifDate;
	private Date registerDate;
	
	public Registration(){
		super();
	}
	
	public Registration(int registrationId, int groupId, int shiftId,
			String userId, Date registerDate, int requestId) {
		
		this.registrationId = registrationId;
		this.groupId = groupId;
		this.courseId = shiftId;
		this.userId = userId;
		this.registerDate = registerDate;
		this.status = 0;
		this.requestId = requestId;
	}

	public int getRequestId() {
		return requestId;
	}

	public void setRequestId(int requestId) {
		this.requestId = requestId;
	}

	public int getRegistrationId() {
		return registrationId;
	}

	public void setRegistrationId(int registrationId) {
		this.registrationId = registrationId;
	}

	public int getGroupId() {
		return groupId;
	}

	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	public int getCourseId() {
		return courseId;
	}

	public void setCourseId(int courseId) {
		this.courseId = courseId;
	}

	public int getStatus() {
		return status;
	}
	
	/**
	 * Method to modify the status of the registration:
	 * -Status 0 = Pendent to revise by Staff.
	 * -Status 1 = Accepted.
	 * -Status 2 = In queue.
	 * @param status (0, 1 or 2)
	 * @throws Exception 
	 */
	public void setStatus(int status) {
		if(status<0|status>3){
			throw new IllegalArgumentException("Status not permitted");
		}
		this.status = status;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public Date getModifDate() {
		return modifDate;
	}

	public void setModifDate(Date modifDate) {
		this.modifDate = modifDate;
	}

	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

}

